# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fping
pkgver=5.2
pkgrel=0
pkgdesc="A utility to ping multiple hosts at once"
url="https://fping.org/"
arch="all"
license="MIT"
makedepends="libcap-utils"
subpackages="$pkgname-doc"
source="https://fping.org/dist/fping-$pkgver.tar.gz"
# setcap: needs cap_net_raw to be able to send icmp packets
options="!check setcap" # no testsuite

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-ipv6
	make
}

package() {
	make install DESTDIR="$pkgdir"
	setcap cap_net_raw=+ep "$pkgdir"/usr/sbin/fping
}

sha512sums="
062896662804c55ffe2d4e3eb7efc2ff796d20a77b367e16f8fa381e302986b5127ca55f0866bbf08f8ae2b2f6795ec4c5d43dc59ebec157fb3e8eff25d0bdb3  fping-5.2.tar.gz
"
